import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import axios from 'axios'
import VueAxios from 'vue-axios'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import echarts from 'echarts'
Vue.config.productionTip = false
Vue.prototype.$echarts = echarts;
import {
  Button
} from 'element-ui';
axios.defaults.headers.common['token']=sessionStorage.getItem('token')


//防止在当前路由跳当前路由报错问题
import Router from 'vue-router'
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}

Vue.prototype.$ELEMENT = {
  size: 'small',
  zIndex: 3000
};
Vue.use(Button);
Vue.use(ElementUI);
Vue.use(VueAxios, axios)

Vue.config.productionTip = false;

new Vue({
  router,
  render: (h) => h(App),
}).$mount("#app");
